<?php
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

$dados = $view->result;
//print '<pre>';
//var_dump($dados);
//die();
?>

<div class="other-ventures">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <h1>Outros Empreendimentos</h1>
                <?php
                foreach($dados as $item):
                    $obj        = $item->_field_data["nid"]["entity"];
//                    print '<pre>';
//                    var_dump($obj);
//                    die();
                    $titulo         = $item->node_title;
                    $situacao       = $item->field_field_situacao_da_obra[0]["rendered"]["#title"];
                    $desc           = @$obj->field_descricao_teaser["und"][0]["value"];
                    $bairro         = $item->field_field_bairro[0]["rendered"]["#title"];
                    $area_inicial   = @$obj->field_area_inicial['und'][0]["value"];
                    $area_final     = @$obj->field_area_final['und'][0]["value"];
                    $emp            = 'de '.$area_inicial.' a '.$area_final;
                    $img_uri        = @$obj->field_imagem_teaser["und"][0]['uri'];
                    $img_url        = image_style_url("255_200",$img_uri);
                    
                    $strUrl         = drupal_get_path_alias('node/'.$item->nid);
                ?>
                <div class="col-md-3">
                    <a href="/<?php print $strUrl; ?>">
                        <div class="grid_x">
                            <span class="details">
                                <div class="category"><?php print $situacao; ?></div>  
                                <h3><?php print $titulo; ?></h3>
                                <ul>
                                    <li><span><i class="ico-home-location"></i><?php print($bairro); ?></span></li>
                                    <li><span><i class="ico-home-room"></i><?php print($desc); ?></span></li>
                                    <li><span><i class="ico-home-lenght"></i><?php print($emp); ?></span></li>
                                </ul>
                            </span>
                            <img src="<?php print $img_url; ?>" alt="">
                        </div>
                    </a>
                </div>
                <?php 
                endforeach;
                ?>
            </div>
        </div>
    </div>
</div>